home *** CD-ROM | disk | FTP | other *** search
/ Clinical Endocrinology / Clinical Endocrinology.iso / mac / 00000000 / 15000000 / Shared.dir / 00908_Script_908 < prev    next >
Text File  |  1995-11-17  |  1KB  |  34 lines

  1. -- This is an all-purpose handler which, when called
  2. -- checks to see if the sprite in the specified channel
  3. -- is being rolled over. If it is being rolled over,
  4. -- then its cast member is swopped for the next in the
  5. -- cast window. The stage is redrawn to show the change
  6. -- and this state is maintained while the mouse is over
  7. -- the same sprite channel. An "if...then" loop in the
  8. -- repeat loop checks to see if the mouse button is 
  9. -- clicked, and if so, sound is played, the playback
  10. -- head is moved to a specified label and the handler
  11. -- is aborted. If the mouse button is not clicked then
  12. -- when the mouse moves off the specified sprite the
  13. -- original cast member is swopped back and the screen
  14. -- is redrawn.
  15.  
  16.  
  17. on flashButton theChannel, theScriptToDo
  18.   
  19.   put the castNum of sprite theChannel into theCast
  20.   repeat while rollOver(theChannel) = true
  21.     set the castNum of sprite theChannel = theCast + 1
  22.     updateStage
  23.     
  24.     if the mouseDown then
  25.       sound playFile 1, "Click.aif"
  26.       do theScriptToDo
  27.       abort
  28.     end if
  29.     
  30.   end repeat
  31.   set the castNum of sprite theChannel = theCast
  32.   updateStage
  33.   
  34. end flashButton